package com.crm.jdy.service.client;

import com.crm.jdy.common.dto.ActivityInfoDto;
import com.crm.jdy.common.pojo.ActivityInfo;
import com.crm.jdy.common.mapper.ActivityInfoMapper;
import com.crm.jdy.common.pojo.CallAplanInfo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**   
 * @Description:(商务活动服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class ActivityInfoServiceImpl  extends ServiceImpl<ActivityInfoMapper,ActivityInfo> implements ActivityInfoService  {

    @Autowired
    ActivityInfoMapper activityInfoDao;

    @Override
    public PageInfo<ActivityInfo> seleteActivityInfoPageInfo(ActivityInfoDto activityInfo) {
        PageHelper.startPage( activityInfo.getCurrentPage(),activityInfo.getPageSize());
        List<ActivityInfo> bookList = activityInfoDao.seleteActivityInfo(activityInfo);
        PageInfo<ActivityInfo> pageInfo = new PageInfo<ActivityInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updateActivityInfo(ActivityInfo activityInfo) {
        return activityInfoDao.updateById(activityInfo) > 0;
    }

    @Override
    public boolean addActivityInfo(ActivityInfo activityInfo) {
        return activityInfoDao.insert(activityInfo) > 0;
    }

    @Override
    public boolean removeActivityInfo(String activityId) {
        return activityInfoDao.deleteById(activityId) > 0;
    }


}